package com.commerceerp.system.service.Impl;

import com.commerceerp.system.entity.FxRoleInfo;
import com.commerceerp.system.mapper.FxRoleInfoMapper;
import com.commerceerp.system.service.FxRoleInfoService;
import com.commerceerp.system.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class FxRoleInfoServiceImpl implements FxRoleInfoService {

    @Autowired
    private FxRoleInfoMapper fxRoleInfoMapper;

    @Override
    public Integer addRoleInfo(FxRoleInfo fxRoleInfo) {

        fxRoleInfo.setRoleCreateTime(DateUtil.getYMDHMSDate());
        fxRoleInfo.setRoleState("1");

        Integer success = this.fxRoleInfoMapper.addRoleInfo(fxRoleInfo);

        return success;
    }

    @Override
    public Integer updateRoleInfo(FxRoleInfo fxRoleInfo) {

        Integer success = this.fxRoleInfoMapper.updateRoleInfo(fxRoleInfo);

        return success;
    }

    @Override
    public Integer deleteRoleInfo(String roleId) {

        Integer success = this.fxRoleInfoMapper.deleteRoleInfo(roleId);

        return success;
    }

    @Override
    public List<FxRoleInfo> getAllRoleInfo(String roleName) {

        List<FxRoleInfo> list = this.fxRoleInfoMapper.getAllRoleInfo(roleName);

        return list;
    }
}
